const router = require('koa-router')();
const recruit = require('../modules/schoolRecruit');

//获取数据
router.get('/schoolrecruit',async(ctx,next) => {
    ctx.body = await recruit.getschoolRecruit();
})
//增加数据
router.post('/schoolrecruit',async(ctx,next) => {
    ctx.body = await recruit.addschoolRecruit(ctx.request.body);
})
//删除数据
router.delete('/schoolrecruit/:school_name',async(ctx,next) => {
    ctx.body = await recruit.deleteschoolRecruit(ctx.params);
})
//修改数据
router.put('/schoolrecruit',async(ctx,next)=>{
    ctx.body = await recruit.putschoolRecruit(ctx.request.body);
})

module.exports = router;
